package com.example;

import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 控制器 博客出处：http://www.cnblogs.com/GoodHelper/
 *
 */
@Controller
public class MainController {

	@Autowired
	private MessageSource messageSource;

	@GetMapping("/index")
	public String index(Model model) {
		model.addAttribute("world",MessageManager.getMsg("world"));
		model.addAttribute("world2",MessageManager.getMsg("world2"));
		return "index";
	}


}
